<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>DOM</title>
</head>

<body>
    <div id="myDiv">
        <!-- ASDHA -->
    </div>
    <script>
    var link = document.createElement('link');
    link.rel = 'stylesheet';
    link.type = "text/css";
    link.herf = 'style.css';
    var head = document.getElementsByTagName('head')[0];
    head.appendChild(link);
    </script>
</body>

</html>